package com.pj.wisdomlogistics.mvp.presenter;


import com.pj.wisdomlogistics.mvp.contract.ApplyMealContract;
import com.pj.wisdomlogistics.mvp.frame.ActivityPresenter;
import com.pj.wisdomlogistics.mvp.model.ApplyMealModel;
import com.pj.wisdomlogistics.rx.FilterSubscriber;


public class ApplyMealPresenter extends ActivityPresenter<ApplyMealModel,ApplyMealContract.View> implements ApplyMealContract.Presenter{
    public static final String TAG = "ApplyMealPresenter";

    @Override
    public void submitDiningApply(String userID, String applyDeptID, String linkman, String linkmanTel,
                                  String officeTel, int diningType, int diningBenchmark, String diningReason,
                                  int peopleCount, String diningTime , String leaderID , String remark,String place) {
        addSubscription(getModel().submitDiningApply(
                userID,
                applyDeptID,
                linkman,
                linkmanTel,
                officeTel,
                diningType,
                diningBenchmark,
                diningReason,
                peopleCount,
                diningTime ,
                leaderID,
                remark,
                place
        ), new FilterSubscriber<Integer>() {
            @Override
            public void onNext(Integer mInteger) {
                getView().onSuccess(mInteger);
            }

            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().onError(errorMsg);
            }

        });
    }
}
